
<script>
	$("#save").on("click",function(){
		var formData = new FormData();
		var file = $("#avatar")[0].files[0];
		formData.append('file', file);
		console.log(file);
		$.ajax({
		    type:'POST',
		    url:"../user?opr=upload",
		    data:formData,
		    dataType: "json", //formData
		    cache: false,
		    contentType: false,
		    processData:false,
		    mimeType:"multipart/form-data",
		    success:function(data){
		        if(data.code==200){
		            layer.msg("保存成功！");
// 		            window.parent.Catalog.table.refresh();
		            $("#user_ico_img").attr("src","../"+data.data);
		        }else{
		            layer.msg(data.msg)
		        }
		    }
		})
	})
</script>
<div class="uc_title m_10 tabs_menu">
	<label class="current node"><span>用户头像修改</span></label>
</div>
<table class="form_table" width="100%" cellpadding="0" cellspacing="0">
	<col width="120px" />
	<col />
	<tr>
		<th>请选择头像：</th>
		<td><input type="file" id="avatar" /><label></label><img id="user_ico_img" src="" width="100"
				height="100" alt="" /></td>
	</tr>
	<tr>
		<th></th>
		<td><label class="btn"><input type="button" id="save"
				value="保存" /></label> <label class="btn"><input type="button"
				id="cancel" value="取消" /></label></td>
	</tr>
</table>
<script>
</script>

